package meeting.department.employee;

import meeting.department.AbstractPart;

import java.util.LinkedList;
import java.util.List;

public class Department extends AbstractPart{
    private String name;
    @Override
    public String getName() {
        return this.name;
    }
    private List<AbstractPart> abstractPartList = new LinkedList<>();

    public Department(String name){
        this.name = name;
    }

    public void add(AbstractPart abstractPart){
        abstractPartList.add(abstractPart);
    }

    public void remove(AbstractPart abstractPart){
        abstractPartList.remove(abstractPart);
    }

    @Override
    public void accept(String meeting) {
        for(AbstractPart abstractPart : abstractPartList){
            abstractPart.accept(meeting);
        }
    }
    public List<AbstractPart> getEmployees(){
        return abstractPartList;
    }
}
